#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char **argv){
	char str[] = "My name is dj";
	char **tmp = (char **)malloc(3*sizeof(char **) );
	char *p = NULL, *t = NULL;
	int count = 0, i = 0, j = 0;
	p = strtok(str, " ");
	while( p ){
		printf("%s\n", p);
		if(i>=3) tmp = (char **)realloc( tmp, (i+1)*sizeof(char **) );
		tmp[i] = p;
		i++;
		p = strtok(NULL, " ");
	}
	count = i - 1;
	while((--i)>=0){
		if(i<=count/2) break;
		t = tmp[i];
		tmp[i] = tmp[count-i];
		tmp[count-i] = t;
	}
	for(j; j<=count; j++) printf("%s ", tmp[j]);
	free(tmp);
	return 0;
}
